package com.yuke.cloud.service.wmc.util;

import java.util.Date;

/*
 * <p>Company: Copyright (c) 2018. yuke All Rights Reserved. </br> </p>
 * <p>Title：yuke-mall </br> </p>
 * <p>com.yuke.cloud.service.wmc.util Description TODO </br> </p>
 * @Author wg
 * @Date   2020/4/24 11:36
 */
public class DateUtil {
    /**
     * 获取某个时间距当前时间的天数.
     *
     * @param dates
     *
     * @return
     */
    public static Integer getCurrentDays(Date dates) {
        long s1=dates.getTime();//将时间转为毫秒
        long s2=System.currentTimeMillis();//得到当回前的毫秒
        Integer day=Math.round(Math.abs((s2-s1))/1000/60/60/24);
        return day;
    }
}
